﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class TypeProcess_ListView : System.Web.UI.Page
{    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            LoadTypeProcess();
        }
    }

    private void LoadTypeProcess()
    {
        Model.TypeProcessManager typeProcess = new Model.TypeProcessManager();
        rptTypeProcess.DataSource = typeProcess.GetAll();
        rptTypeProcess.DataBind();
    }

    protected void rpt_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "Display")
        {
            Response.Redirect("DisplayForm.aspx?id=" + e.CommandArgument.ToString());
        }       
    }

    protected void btnAddNew_Click(object sender, EventArgs e)
    {
        Response.Redirect("NewForm.aspx");
    }
}